#ifndef __TIMER_H__
#define __TIMER_H__

#include "app_types.h"
#include "timer_hw.h"

#define NUM_MSEC_TIMER		10

struct timer_t
{
	uint16_t ms[NUM_MSEC_TIMER];
	uint16_t alive;
	uint16_t wait_ms;
	uint8_t datetime_upd_100ms;
	uint8_t hang_timeout_100ms;
	uint8_t loop_hang_timeout_100ms;
};

extern volatile struct timer_t timer;

void init_timer();
void exit_timer();
int8_t getTimer();
void wait_ms(uint16_t msec);
void timer_isr();
uint8_t timer_get_keys();
void timer_reset_keys();

#endif // __TIMER_H__
